<?php
namespace app\common\model;
use think\Model;
/**
* 菜单
* @author xuyunlong <416319808@qq.com>
*/
class Menu extends Model
{

    /**
     * 获取菜单
     * @return Object        结果集
     */
    public function node($type=true)
    {

    	// $data = self::all(function ($query)
    	// {
    	// 	$query->field('*')->order('id');
    	// });

        $data = self::order('id');
        if(!$type){
            $data = $data->where('isdis',0);
        }
        $data = $data->select();
    	return tree($data);
    }

}
